package mephisto.rest;

import java.io.IOException;
import java.util.UUID;

import org.restlet.data.Form;
import org.restlet.data.Protocol;
import org.restlet.data.Response;

public class Client  {
	
	
	public static void main(String[] args) {
	Form input = new Form();
    input.add("id","arkub");
    input.add("password","kubar");
    input.add("content","=Straight to hell=");
    //UUID uuid = UUID.randomUUID();
    //input.add("content[id]",uuid.toString());
    String uri = "http://localhost:8182/storage/top" ;
    org.restlet.Client client = new org.restlet.Client(Protocol.HTTP);
    Response res = client.put(uri, input.getWebRepresentation());
    String text;
	try {
		text = res.getEntity().getText();
		System.out.println(text);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
    
	}
}
